Background: Recently a book was written regarding the new political system (Domain State), which awaits us in the near future. And since Roskomnadzor reacts inadequately to such things, I decided to create a website for my writings on the private i2p network. In the process of creation, I had to solve some technical issues, which I will consider below, trying to save your time, at the same time I will also have a cheat sheet.
So, I have a remote VPS for Ubuntu, and I need to host the site on it. Because, of course, you can do it on your laptop, but when the laptop is turned off, the site is inaccessible (personally, this invariably annoys me in .i2p and .onion).
Next, I assume that your LAMP is already configured and normally sends content to the regular Internet. Those. you already have a couple of regular (non-i2p) sites running on it.
First install i2p on Ubuntu:
Configuring the i2p router as a constantly running daemon:
During configuration (via the graphical interface) you will need to answer a few simple questions, set autorun, I left the memory at the default 128 MB, in general, I think you won’t have any problems with this.
Once configuration is complete, the i2p daemon will start on its own.
Now we need the panel with the web interface of the i2p router to be accessible remotely. To do this, open the file
And we change it
on
Where instead
Set the external IP of your VPS. There is another option (from the i2p developers) where you can replace with:
but I haven't tried it.
Now you have access to a web interface for managing your remote i2p router.
FIRST THING you go to:
(instead of 80.80.80.80, substitute the IP of your VPS) and set a login password (so that no one gets stolen). Now only you have access to the web console (well, I hope so).
The manual recommends: «Go to localhost:7657/index.jsp and click on Soft Restart, this will restart the JVM and all applications». Do it. Don't forget to substitute the IP of your VPS instead of localhost.
Now here's the problem with i2p under Ubuntu 16.04: in the left panel of the web console you will see the message:
This is due to the fact that Ubuntu 16.04 uses... well, you need to install another Java, stable one. I chose the option from Oracle.
and onwards:
Now all you have to do is create a new HTTP tunnel to your site. You can do this here:
(Just change the IP)
Select “New open service”» — http (is the default) and click “Create”. In field
Specify the IP of your VPS. Specify the port on which the server is running (say, apache2, usually 80 or 8080), and in the field:
You write something like:
Check the box for autorun. Change at will Name(N) And Description(e).
Don't touch the rest. Click on “Save».
Voila! Now your site is visible using a 32-bit key address (like this: pqajparec44p74uvpxvxhpd5u3neuqs2t4awwd6bcieku3juhwwa.b32.i2p ) in i2p network. And if you add your site to the address books of various services, for example, here: stats.i2p, then over time your domain name will moysite.i2p, which you specified earlier will be included in the address books of other services. And your site will be found directly by this name, or through jump services.
That's a good question. In general, I also tested the installation on a working server with virtual hosts and resolved the issue this way: I assigned a different port to the site for i2p (which we specified earlier when creating the tunnel). Let's do this together. Opening:
And write there:
For example, let's say this is the port number 8088.
To another config:
You write something like:
(be sure to close the tag VirtualHost — on Habré there is a glitch with the display of this piece of code)
DocumentRoot Of course, change the path to the real one, to the one where you actually have the folder DocumentRoot for your i2p site. If there is no such thing, create one. Save everything. Restart Apache:
If you don’t want your i2p site to be visible from the regular Internet, put it in the DocumentRoot directory .htaccess following contents:
80.80.80.80 – change to the IP of your VDS.
Go to stats.i2p and add your site to the local service.
After adding, your site becomes accessible, for example, like this:
stats.i2p/cgi-bin/jump.cgi?a=r.i2p
(this is the website address that I made)
And yes, in general, it is more logical not to host an i2p site on a working VPS. It's better to take something separate for i2p. Well, that's how I see it.
If there is additional questions about installation - welcome to comments.
Links to used docs:
→ geti2p.net/ru/faq
→ help.ubuntu.ru/wiki/i2p
→ help.ubuntu.ru/wiki/java
So, I have a remote VPS for Ubuntu, and I need to host the site on it. Because, of course, you can do it on your laptop, but when the laptop is turned off, the site is inaccessible (personally, this invariably annoys me in .i2p and .onion).
Next, I assume that your LAMP is already configured and normally sends content to the regular Internet. Those. you already have a couple of regular (non-i2p) sites running on it.
First install i2p on Ubuntu:
sudo apt-add-repository ppa:i2p-maintainers/i2p
sudo apt-get update
sudo apt-get install i2p
Configuring the i2p router as a constantly running daemon:
sudo dpkg-reconfigure -plow i2p
During configuration (via the graphical interface) you will need to answer a few simple questions, set autorun, I left the memory at the default 128 MB, in general, I think you won’t have any problems with this.
Once configuration is complete, the i2p daemon will start on its own.
Now we need the panel with the web interface of the i2p router to be accessible remotely. To do this, open the file
/var/lib/i2p/i2p-config/clients.config
And we change it
clientApp.0.args=7657 ::1,127.0.0.1 ./webapps/
on
clientApp.0.args=7657 80.80.80.80 ./webapps/
Where instead
80.80.80.80
Set the external IP of your VPS. There is another option (from the i2p developers) where you can replace with:
clientApp.0.args=7657 0.0.0.0 ./webapps/
but I haven't tried it.
Now you have access to a web interface for managing your remote i2p router.
FIRST THING you go to:
http://80.80.80.80:7657/configui
(instead of 80.80.80.80, substitute the IP of your VPS) and set a login password (so that no one gets stolen). Now only you have access to the web console (well, I hope so).
The manual recommends: «Go to localhost:7657/index.jsp and click on Soft Restart, this will restart the JVM and all applications». Do it. Don't forget to substitute the IP of your VPS instead of localhost.
Now here's the problem with i2p under Ubuntu 16.04: in the left panel of the web console you will see the message:
Please note: ECDSA is not available. Update Java or OS.
This is due to the fact that Ubuntu 16.04 uses... well, you need to install another Java, stable one. I chose the option from Oracle.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
and onwards:
sudo update-java-alternatives -s java-8-oracle
Now all you have to do is create a new HTTP tunnel to your site. You can do this here:
http://80.80.80.80:7657/i2ptunnelmgr
(Just change the IP)
Select “New open service”» — http (is the default) and click “Create”. In field
Access Point: Address(H):
Specify the IP of your VPS. Specify the port on which the server is running (say, apache2, usually 80 or 8080), and in the field:
Website name(W):
You write something like:
moysite.i2p
Check the box for autorun. Change at will Name(N) And Description(e).
Don't touch the rest. Click on “Save».
Voila! Now your site is visible using a 32-bit key address (like this: pqajparec44p74uvpxvxhpd5u3neuqs2t4awwd6bcieku3juhwwa.b32.i2p ) in i2p network. And if you add your site to the address books of various services, for example, here: stats.i2p, then over time your domain name will moysite.i2p, which you specified earlier will be included in the address books of other services. And your site will be found directly by this name, or through jump services.
But if my server serves multiple virtualhosts on the same socket, how do I know which domain will be visible on the i2p network?
That's a good question. In general, I also tested the installation on a working server with virtual hosts and resolved the issue this way: I assigned a different port to the site for i2p (which we specified earlier when creating the tunnel). Let's do this together. Opening:
/etc/apache2/ports.conf
And write there:
Listen 8088
For example, let's say this is the port number 8088.
To another config:
/etc/apache2/sites-enabled/000-default.conf
You write something like:
<VirtualHost *:8088>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/moysite
ErrorLog ${APACHE_LOG_DIR}/error8088.log
CustomLog ${APACHE_LOG_DIR}/access8088.log combined
</VirtualHost>
(be sure to close the tag VirtualHost — on Habré there is a glitch with the display of this piece of code)
DocumentRoot Of course, change the path to the real one, to the one where you actually have the folder DocumentRoot for your i2p site. If there is no such thing, create one. Save everything. Restart Apache:
sudo service apache2 restart
If you don’t want your i2p site to be visible from the regular Internet, put it in the DocumentRoot directory .htaccess following contents:
Order deny,allow
Deny from all
Allow from 80.80.80.80
80.80.80.80 – change to the IP of your VDS.
Go to stats.i2p and add your site to the local service.
After adding, your site becomes accessible, for example, like this:
stats.i2p/cgi-bin/jump.cgi?a=r.i2p
(this is the website address that I made)
And yes, in general, it is more logical not to host an i2p site on a working VPS. It's better to take something separate for i2p. Well, that's how I see it.
If there is additional questions about installation - welcome to comments.
Links to used docs:
→ geti2p.net/ru/faq
→ help.ubuntu.ru/wiki/i2p
→ help.ubuntu.ru/wiki/java